package cn.edu.bcu.ls.service;

import cn.edu.bcu.ls.entity.Order;
import cn.edu.bcu.ls.mapper.OrderMapper;
import cn.edu.bcu.ls.serviceImpl.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService{
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public int deleteByPrimaryKey(Integer oId) {
        return orderMapper.deleteByPrimaryKey(oId);
    }

    @Override
    public int insert(Order order) {
        return orderMapper.insert(order);
    }

    @Override
    public int insertSelective(Order order) {
        return orderMapper.insertSelective(order);
    }

    @Override
    public int update(Order order) {
        return orderMapper.updateByPrimaryKey(order);
    }

    @Override
    public List<Order> selectByPrimaryKey(Integer oId,Integer cId,Integer uId) {
        Map map = new HashMap();
        map.put("oId",oId);
        map.put("cId",cId);
        map.put("uId",uId);
        return orderMapper.getList(map);
    }
}
